From: Giovanni Campagna Date: Thu, 25 Oct 2012 16:30:27 +0000 (+0200) Subject: MessageTray: destroy notifications manually when the source is destroyed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3819 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ed0e8809138980f0c5ccc023808598a14d8e07ed;p=gnome-shell.git MessageTray: destroy notifications manually when the source is destroyed Using a signal handlers causes us to depend on connection order, but we need the message tray code to run last, so it can notice that notifications are destroyed when hiding the boxpointer and skip the broken animation. https://bugzilla.gnome.org/show_bug.cgi?id=686855 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 6b297b727..bf333ec19 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -404,11 +404,6 @@ const Notification = new Lang.Class({ this._soundFile = null; this._soundPlayed = false; - source.connect('destroy', Lang.bind(this, - function (source, reason) { - this.destroy(reason); - })); - this.actor = new St.Button({ accessible_role: Atk.Role.NOTIFICATION }); this.actor.add_style_class_name('notification-unexpanded'); this.actor._delegate = this; @@ -1337,6 +1332,13 @@ const Source = new Lang.Class({ destroy: function(reason) { this.policy.destroy(); + + let notifications = this.notifications; + this.notifications = []; + + for (let i = 0; i < notifications.length; i++) + notifications[i].destroy(reason); + this.emit('destroy', reason); },